﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="js/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="js/protobuf.js"></script>
    <script src="js/protobufFactory.js"></script>
    <script src="wsprotobuf.js"></script>
</head>
<body>
    <div id="app">
        <el-form :inline="true" :model="user" class="demo-form-inline" size="mini">
            <el-form-item label="Name">
                <el-input v-model="user.Name" placeholder="Name"></el-input>
            </el-form-item>
            <el-form-item label="Email">
                <el-input v-model="user.Email" placeholder="Email"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSend">Sebd</el-button>
            </el-form-item>
        </el-form>
        <div>
            <p>Name:{{result.Name}}</p>
            <p>EMail:{{result.Email}}</p>
            <p>Response:{{result.ResponseTime}}</p>
        </div>
    </div>
    <script>
        var vue = new Vue({
            el: '#app',
            data: {
                user: new User(),
                result: {}
            },
            methods: {
                async onSend() {
                    this.result = await this.$receiveFrom(this.user);
                }
            },
            mounted() {

            }
        });
    </script>
</body>

</html>